<#include "../../select.ftl" />
<#--<div class="form-group col-md-4">
    <label class="col-sm-4 control-label">产品id</label>
    <div class="col-sm-8">

    </div>
</div>-->
<div class="row">

    <div class="form-group col-md-4">
        <label class="col-sm-4 control-label">产品名称</label>

        <div class="col-sm-8">
            <div class="input-group">
                <input type="hidden" name="vipId" value="${ykOrder.vipId!''}" type="text" class="form-control"/>
                <input name="productName" value="${ykOrder.productName!''}" type="text" class="form-control"/>
     <span class="input-group-addon" onclick="dorefreshcardtype(this);"><i
             class="fa fa-search"></i></span>
            </div>
        </div>
    </div>
    <div class="form-group col-md-4">
        <label class="col-sm-4 control-label">会员类型</label>

        <div class="col-sm-8">
        <@select name="vipType"  value="${ykOrder.vipType!''}" list=vipTypeList class="form-control"/>
            <#--<input name="vipType" value="${ykOrder.vipType!''}" type="text" class="form-control"/>-->
        </div>
    </div>
    <div class="form-group col-md-4">
        <label class="col-sm-4 control-label">金额</label>

        <div class="col-sm-8">
            <input name="money" id="money" value="${ykOrder.money!''}" type="text" class="form-control"
                   onblur=funMoney()/>
        </div>
    </div>
    <div class="form-group col-md-4">
        <label class="col-sm-4 control-label">周期</label>

        <div class="col-sm-8">
            <input name="vipCycle" id="vipCycle" value="${ykOrder.vipCycle!''}" type="text" class="form-control"/>
        </div>
    </div>

    <div class="form-group col-md-4">
        <label class="col-sm-4 control-label">上门次数</label>

        <div class="col-sm-8">
            <input name="doorNum" value="${ykOrder.doorNum!''}" type="text" class="form-control"/>
        </div>
    </div>
    <div class="form-group col-md-4">
        <label class="col-sm-4 control-label">上门金额</label>

        <div class="col-sm-8">
            <input name="doorMoney" value="${ykOrder.doorMoney!''}" type="text" class="form-control"/>
        </div>
    </div>
    <div class="form-group col-md-4">
        <label class="col-sm-4 control-label">成本类型</label>

        <div class="col-sm-8">
        <@select name="costType"  id="costType"  value="${ykOrder.costType!''}" list=costTypeList class="form-control"/>
            <#--<input name="costType" id="costType" value="${ykOrder.costType!''}" type="text" class="form-control"/>-->
        </div>
    </div>
    <div class="form-group col-md-4">
        <label class="col-sm-4 control-label">成本金额或比例</label>

        <div class="col-sm-8">
            <input name="costMoney" id="costMoney" value="${ykOrder.costMoney!''}" type="text" class="form-control"
                   onblur=funMoney()/>
        </div>
    </div>
    <div class="form-group col-md-4">
        <label class="col-sm-4 control-label">成本</label>

        <div class="col-sm-8">
            <input name="cost" id="cost" value="${ykOrder.cost!''}" type="text" class="form-control"/>
        </div>
    </div>
</div>
<script>
    $(function () {
        $("select[name=costType]").change(function () {
            if ($("input[id='money']").val() != '' && $("#costType").val() != '' && $("input[id='costMoney']").val() != '') {
                if ($("#costType").val() == '1') {
                    $("#ykOrderForm input[id='cost']").val($("input[id='costMoney']").val());
                }
                if ($("#costType").val() == '2') {
                    $("#ykOrderForm input[id='cost']").val($("input[id='costMoney']").val() * $("input[id='money']").val());
                }
            }
            else {
                $.showMessage({parentId: "errorMessage", message: "<strong>错误信息</strong>：" + "金额或成本类型或成本金额比例不能为空", type: "error"});
            }
        });

    });
</script>